package com.javatip.project.deep_learning.trainMission.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.javatip.framework.web.domain.BaseEntity;

import java.util.Date;

/**
 * 训练任务表 train_mission
 *
 * @author 袁伟
 * @date 2024-07-12
 */
public class TrainMission extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    private Integer id;

    /** 训练任务名称 */
    private String trainMissionName;
    /**
     * 模型
     */
    private String model;
    /**
     * 数据集
     */
    private String datasetTrain;
    /**
     * 验证数据集
     */
    private String datasetVal;
    /**
     * batch_size
     */
    private Integer batchSize;
    /**
     * 最小训练轮数
     */
    private Integer minEpoch;
    /**
     * 最大训练轮数
     */
    private Integer maxEpoch;
    /**
     * 训练状态
     */
    private String status;
    /**
     * 早停
     */
    private Integer earlyStop;
    /**
     * 学习率
     */
    private Float opLr;
    /**
     * 归属用户
     */
    private Integer userId;
    /**
     *
     */
    private Integer datasetTrainId;
    /**
     *
     */
    private Integer datasetValId;
    /**
     * 模型id
     */
    private Integer modelId;

    /** 开始时间 */
    private Date beginTime;
    /** 结束时间 */
    private Date endTime;

    /** 是否公开 */
    private Integer isPublic;

    private String userName;  // 用户名,不进数据库

    private boolean isRunning; // true: 进行中, false: 停止

    private boolean isWeight; // true: 使用权重文件, false: 不使用权重文件

    public Date getTimeToQueue() {
        return timeToQueue;
    }

    public boolean getIsWeight() {
        return isWeight;
    }

    public void setIsWeight(boolean weight) {
        this.isWeight = weight;
    }

    public void setTimeToQueue(Date timeToQueue) {
        this.timeToQueue = timeToQueue;
    }

    /** 添加进队列的时间 */
    private Date timeToQueue;

    public boolean isRunning() {
        return isRunning;
    }

    public void setRunning(boolean running) {
        isRunning = running;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }
    public void setTrainMissionName(String trainMissionName)
    {
        this.trainMissionName = trainMissionName;
    }

    public String getTrainMissionName()
    {
        return trainMissionName;
    }
    public void setModel(String model) {
        this.model = model;
    }

    public String getModel() {
        return model;
    }

    public void setDatasetTrain(String datasetTrain) {
        this.datasetTrain = datasetTrain;
    }

    public String getDatasetTrain() {
        return datasetTrain;
    }

    public void setDatasetVal(String datasetVal) {
        this.datasetVal = datasetVal;
    }

    public String getDatasetVal() {
        return datasetVal;
    }

    public void setBatchSize(Integer batchSize) {
        this.batchSize = batchSize;
    }

    public Integer getBatchSize() {
        return batchSize;
    }

    public void setMinEpoch(Integer minEpoch) {
        this.minEpoch = minEpoch;
    }

    public Integer getMinEpoch() {
        return minEpoch;
    }

    public void setMaxEpoch(Integer maxEpoch) {
        this.maxEpoch = maxEpoch;
    }

    public Integer getMaxEpoch() {
        return maxEpoch;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatus() {
        return status;
    }

    public void setEarlyStop(Integer earlyStop) {
        this.earlyStop = earlyStop;
    }

    public Integer getEarlyStop() {
        return earlyStop;
    }

    public void setOpLr(Float opLr) {
        this.opLr = opLr;
    }

    public Float getOpLr() {
        return opLr;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setDatasetTrainId(Integer datasetTrainId) {
        this.datasetTrainId = datasetTrainId;
    }

    public Integer getDatasetTrainId() {
        return datasetTrainId;
    }

    public void setDatasetValId(Integer datasetValId) {
        this.datasetValId = datasetValId;
    }

    public Integer getDatasetValId() {
        return datasetValId;
    }

    public void setModelId(Integer modelId) {
        this.modelId = modelId;
    }

    public Integer getModelId() {
        return modelId;
    }

    public void setBeginTime(Date beginTime)
    {
        this.beginTime = beginTime;
    }

    public Date getBeginTime()
    {
        return beginTime;
    }
    public void setEndTime(Date endTime)
    {
        this.endTime = endTime;
    }

    public Date getEndTime()
    {
        return endTime;
    }
    public void setIsPublic(Integer isPublic)
    {
        this.isPublic = isPublic;
    }

    public Integer getIsPublic()
    {
        return isPublic;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("trainMissionName", getTrainMissionName())
                .append("model", getModel())
                .append("datasetTrain", getDatasetTrain())
                .append("datasetVal", getDatasetVal())
                .append("batchSize", getBatchSize())
                .append("minEpoch", getMinEpoch())
                .append("maxEpoch", getMaxEpoch())
                .append("status", getStatus())
                .append("earlyStop", getEarlyStop())
                .append("opLr", getOpLr())
                .append("userId", getUserId())
                .append("datasetTrainId", getDatasetTrainId())
                .append("datasetValId", getDatasetValId())
                .append("modelId", getModelId())
                .append("beginTime", getBeginTime())
                .append("endTime", getEndTime())
                .append("timeToQueue", getTimeToQueue())
                .append("isPublic", getIsPublic())
                .append("userName", getUserName())
                .append("isWeight", getIsWeight())
                .toString();
    }
}
